package com.xianyun.site.iblog.convertor;

import com.xianyun.site.iblog.domain.blog.model.Article;
import com.xianyun.site.iblog.gatewayimpl.database.domainobject.ArticleDO;
import org.springframework.beans.BeanUtils;

/**
 * 文章类型转换
 * @author mac_zyj
 */
public class ArticleConvertor {
    public static ArticleDO toDataObject(Article article){
        ArticleDO articleDO = new ArticleDO();
        BeanUtils.copyProperties(article, articleDO);
        return articleDO;
    }
    public static Article toEntity(ArticleDO articleDO){
        Article article = new Article();
        BeanUtils.copyProperties(articleDO, article);
        return article;
    }
}
